package com.gin.kotlin.no_gay_alliance.database.entity

import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.Index
import androidx.room.PrimaryKey
import java.time.ZonedDateTime

/**
 * 回复历史任务日志
 * @property id Int
 * @property taskId 任务id
 * @property code 请求code
 * @property message 请求消息
 * @property timestamp 创建时间
 * @constructor
 */
@Entity(
    indices = [
        // 搜索用索引
        Index(value = ["taskId", "timestamp"]),
    ],
)
data class ReplyHistoryTaskLog(
    @PrimaryKey(true)
    var id: Int = 0,
    @ColumnInfo(index = true)
    var taskId: Int,
    var code: Int = 200,
    var message: String = "",
    @ColumnInfo(defaultValue = "0", index = true)
    var timestamp: ZonedDateTime = ZonedDateTime.now(),
)

